#ifdef a
//学生信息管理系统
#include"Stu.h"

//文件读取时所用的节点创建
Stu* ReadBuyStuNode() {
	Stu* new_node = (Stu*)malloc(sizeof(Stu));
	if (!new_node) {
		perror("空间申请错误!\n");
		return NULL;
	}
	//strcpy(new_node->cell_phone_number, "11111111111");
	/*new_node->english = 00;
	new_node->math = 00;d
	strcpy(new_node->name, "初始化");
	strcpy(new_node->sex, "无");
	strcpy(new_node->stu_number, "111111111111");*/
	new_node->next = NULL;
	return new_node;
}


//将文件内容读取入链表
void ReadMyFile(Stu** stu_node) {
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	Stu* cur = *stu_node;
	Stu* new_node = ReadBuyStuNode();
	//文件中为空，直接返回0，否则进入while循环
	while (fread(new_node, 1, sizeof(Stu), fp)) {
		if (!(*stu_node)) {
			*stu_node = new_node;
		}
		else {
			cur = *stu_node;
			while (cur->next) {
				cur = cur->next;
			}
			cur->next = new_node;
			
		}
		new_node = ReadBuyStuNode();
	}
	fclose(fp);
	return;
}

//管理员登录信息文件的创建
void CreateAdminFile() {
	FILE* admin_fp = fopen("admin.bin", "rb+");
	if (!admin_fp) {
		admin_fp = fopen("admin.bin", "wb+");
		if (!admin_fp) {
			perror("create admin_file error:");
			assert(1);
		}
	}
	Admin admin;
	strcpy(admin.account, ACCOUNT);
	strcpy(admin.password, PASSWORD);
	//默认管理员账户写入文件中（若要添加更多，可自行在文件中添加或自定义添加函数》注意每次程序运行时的覆盖问题）
	fwrite(&admin, 1, sizeof(Admin), admin_fp);
	fclose(admin_fp);
	return;
}
//管理员登录
void AdminLogIn() {
	FILE* admin_fp = fopen("admin.bin", "rb+");
	if (!admin_fp) {
		perror("open file error:");
		assert(1);
	}
	Admin temp, put_in;
	Color(15);
	printf("请输入管理员账号>>");
	scanf("%s", put_in.account);
	printf("请输入管理员密码>>");
	scanf("%s", put_in.password);
	while (fread(&temp, 1, sizeof(Admin), admin_fp)) {
		if (!strcmp(temp.account, put_in.account) && !strcmp(temp.password, put_in.password)) {
			admin_flag = 1;
			MyTime();
			printf("*********	  管理员账户登录成功!    ********\n");
			break;
		}
		else{
			printf("账号或密码错误,退出登录系统\n");
			break;
		}
	}
	fclose(admin_fp);
	return;
}

//学生信息文件的创建
void CreateMyFile() {
	FILE* fp = NULL;
	fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		fp = fopen("stu infornation.bin", "wb+");
		if (!fp) {
			perror("create file error:");
			assert(1);
		}
	}
	fclose(fp);
	return;
}

//初始页面
void Menu() {
	printf("******************               学生信息管理平台         *************************\n");
	printf("***********         1.添加学生信息            2.修改学生信息(姓名|学号) ***********\n");
	printf("***********         3.查询学生信息            4.打印学生信息            ***********\n");
	printf("***********         5.刷新页面                6.删除学生信息(姓名&学号) ***********\n");
	printf("***********         7.刷新所有学生信息        8.打印目前学生人数        ***********\n");
	printf("***********         9.排序 & 统计             0.退出系统               ***********\n");

}

void Color(int color) {
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color); //颜色设置
}
//合法性检查
void Check(Stu* new_node, int flag) {
	switch (flag) {
	case 1://性别
		while (1) {
			if ((strcmp(new_node->sex, "男") != 0) && (strcmp(new_node->sex, "女") != 0)) {
				printf("\n性别错误,请重新输入>>");
				scanf("%s", new_node->sex);
			}
			else
				break;
		}
		break;
	case 2://学号（2021 0702 0530） 12位
		//合法性检验
		while (1) {
			if (strlen(new_node->stu_number) != 12) {
				printf("\n学号位数错误，请重新输入>>");
				scanf("%s", new_node->stu_number);
			}
			else
				break;
		}
		//是否重复
		Stu read_in_file1;
		FILE* fp = fopen("stu infornation.bin", "rb+");
		if (!fp) {
			perror("open file error:");
			assert(1);
		}
		while (fread(&read_in_file1, 1, sizeof(Stu), fp)){
			if (!(strcmp(read_in_file1.stu_number, new_node->stu_number))) {
				printf("输入学号重复,请重新输入>>");
				scanf("%s", new_node->stu_number);
			}				
		}
		fclose(fp);
		break;

	case 3://手机号合法性检查(150 3111 3186) 11位
		while (1) {
			if (strlen(new_node->cell_phone_number) != 11) {
				printf("\n手机号位数错误，请重新输入>>");
				scanf("%s", new_node->cell_phone_number);
			}
			else
				break;
		}
		break;
	case 4://成绩合法性检查(0~100)
		while (1) {
			if (!((new_node->math >= 0) && (new_node->math <= 100))) {
				printf("\n数学成绩输入错误，请重新输入>>");
				scanf("%d", &new_node->math);

			}
			else if (!(new_node->english >= 0 && new_node->english <= 100)) {
				printf("\n英语成绩输入错误，请重新输入>>");
				scanf("%d", &new_node->english);
			}
			else
				break;
		}
		break;

	case 5://姓名重复性检查
	{
		Stu read_in_file2;
		FILE* fp = fopen("stu infornation.bin", "rb+");
		if (!fp) {
			perror("open file error:");
			assert(1);
		}
		while (fread(&read_in_file2, 1, sizeof(Stu), fp)) {
			if (!(strcmp(read_in_file2.name, new_node->name))) {
				printf("输入姓名重复,请重新输入>>");
				scanf("%s", new_node->name);
			}
		}
		fclose(fp);
		break;
	}

	default:
		break;
	}
	return;
}

//交换函数
void Swap(Stu** p1, Stu** p2) {
	Stu* temp = *p1;
	*p1 = *p2;
	*p2 = temp;
	return;
}

//成绩比较
void MyCompare(Stu* qsort_stu[], int sz, int select) {
	int flag = 0;
	for (int i = 0; i < sz - 1; i++) {
		flag = 0;
		for (int j = 0; j < sz - i - 1; j++) {
			if (select == 3) {
				if (qsort_stu[j]->aggregrate_score < qsort_stu[j + 1]->aggregrate_score) {
					Swap(&qsort_stu[j], &qsort_stu[j + 1]);
					flag = 1;
				}
			}
			else if (select == 2) {
				if (qsort_stu[j]->math < qsort_stu[j + 1]->math) {
					Swap(&qsort_stu[j], &qsort_stu[j + 1]);
					flag = 1;
				}
			}
			else if (select == 1) {
				if (qsort_stu[j]->english < qsort_stu[j + 1]->english) {
					Swap(&qsort_stu[j], &qsort_stu[j + 1]);
					flag = 1;
				}
			}
		}
		if (!flag)
			break;
	}
	return;
}


//涉及排名的打印
void PrintRank(Stu* qsort_stu[], int sz) {
	printf("排名\t    名字\t    性别\t   学号\t\t    手机号\t    数学成绩\t   英语成绩\t   总成绩\n");
	int rank = 1;
	for (int i = 0; i < sz; i++) {
		qsort_stu[i]->place = rank;
		printf("%-12d", qsort_stu[i]->place);
		printf("%-17s", qsort_stu[i]->name);
		printf("%-10s", qsort_stu[i]->sex);
		printf("%-19s", qsort_stu[i]->stu_number);
		printf("%-20s", qsort_stu[i]->cell_phone_number);
		printf("%-16d", qsort_stu[i]->math);
		printf("%-15d", qsort_stu[i]->english);
		printf("%d\n", qsort_stu[i]->aggregrate_score);
		rank++;
	}
}

//统计数学情况（最高分，最低分，平均分，不及格人数）
void StatisticsMath() {
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	} 
	Stu in_file;
	double average;
	int sum = 0, size = 0, count = 0, max, min;
	max = 0;
	min = 100;
	while (fread(&in_file, 1, sizeof(Stu), fp)) {
		count++;
		if (in_file.math >= max)
			max = in_file.math;
		if (in_file.math <= min)
			min = in_file.math;
		sum += in_file.math;
		if (in_file.math < 60)
			size++;
	}
	average = 1.0 * sum / count;
	printf("数学最高分: %d\n", max);
	printf("数学最低分: %d\n", min);
	printf("数学平均分: %.2lf\n", average);
	printf("不及格人数: %d\n", size);
	fclose(fp);
	return;
}

//统计英语
void StatisticsEnglist() {
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	Stu in_file;
	double average;
	int sum = 0, size = 0, count = 0, max, min;
	max = 0;
	min = 100;
	while (fread(&in_file, 1, sizeof(Stu), fp)) {
		count++;
		if (in_file.english >= max)
			max = in_file.english;
		if (in_file.english <= min)
			min = in_file.english;
		sum += in_file.english;
		if (in_file.english < 60)
			size++;
	}
	average = 1.0 * sum / count;
	printf("英语最高分: %d\n", max);
	printf("英语最低分: %d\n", min);
	printf("英语平均分: %.2lf\n", average);
	printf("不及格人数: %d\n", size);
	fclose(fp);
	return;
}
//统计 & 排序（只改变链表信息，不改变文件信息）
void RankAggregateScore(Stu* stu_node) {
	if (!stu_node){
		printf("链表为空\n");
		return;
	}
	int count = 0;
	Stu* qsort_stu[50] = { 0 };
	Stu* cur = stu_node;
	while (cur) {
		qsort_stu[count++] = cur;
		cur = cur->next;
	}
	char select = 0;
	//统计（最高分，最低分，平均分，不及格人数）
	printf("****    1.按照英语成绩排序         2.按照数学成绩排序     ****\n");
	printf("****    3.按照总成绩排序           4.统计数学情况         ****\n");
	printf("****    5.统计英语情况             0.退出                 ****\n");
	printf("请输入操作选项>>");
	scanf(" %c", &select);
	switch (select) {
	case '0':
		printf("****    退出    ****\n");
		break;
	case '4':
		Color(14);
		StatisticsMath();//统计数学情况（最高分，最低分，平均分，不及格人数）
		break;
	case '5':
		Color(14);
		StatisticsEnglist();//统计英语情况（最高分，最低分，平均分，不及格人数）
		break;
	case '3':
		MyCompare(qsort_stu, count, 3);
		PrintRank(qsort_stu, count);
		break;
	case '1':
		MyCompare(qsort_stu, count, 1);
		PrintRank(qsort_stu, count);
		break;
	case '2':
		MyCompare(qsort_stu, count, 2);
		PrintRank(qsort_stu, count);
		break;
	default:
		printf("输入选项非法\n");
		break;
	}
	return;
}
//节点创建
Stu* BuyStuNode() {
	Stu* new_node = (Stu*)malloc(sizeof(Stu));
	if (!new_node) {
		perror("空间申请错误!\n");
		return NULL;
	}
	printf("请输入学生姓名>>");
	scanf("%s", new_node->name);
	//姓名可以重复,但该程序中不允许姓名重复,查找函数和小打印函数设置为只能查找并打印一个学生信息
	Check(new_node, 5);


	printf("请输入学生性别>>");
	scanf("%s", new_node->sex);
	//性别合法性检查
	Check(new_node, 1);

	printf("请输入学生学号>>");
	scanf("%s", new_node->stu_number);
	//学号合法性检查
	//学号不能重复
	Check(new_node, 2);

	printf("请输入学生手机号>>");
	scanf("%s", new_node->cell_phone_number);
	//手机号合法性检查
	Check(new_node, 3);

	printf("请输入学生数学成绩>>");
	scanf("%d", &new_node->math);

	printf("请输入学生英语成绩>>");
	scanf("%d", &new_node->english);
	//成绩合法性检查
	Check(new_node, 4);

	new_node->place = 0;
	new_node->aggregrate_score = new_node->math + new_node->english;

	new_node->next = NULL;
	printf("添加成功\n");

	return new_node;
	/*
	//数组只能整体初始化，而不能进行整体赋值，也可以采用strcpy的方式
	strcpy(new_node->sex, "无");
	strcpy(new_node->name, "无");
	strcpy(new_node->cell_phone_number, "无");
	strcpy(new_node->stu_number, "无");
	*/
}
//有效节点个数的打印
void PrintSize(Stu* stu_node) {
	int size = 0;
	Stu* cur = stu_node;
	while (cur) {
		cur = cur->next;
		size++;
	}
	printf("当前已记录学生数为:%d\n", size);
	return;
}
//添加学生信息(尾插)
void IncreaseStuInfo(Stu** stu_node) {
	assert(stu_node);
	//空(首次添加)
	Stu* newnode = BuyStuNode();

	if (!*stu_node)
		*stu_node = newnode;
	else{
		Stu* cur = *stu_node;
		while (cur->next) 
			cur = cur->next;
		cur->next = newnode;
	}
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	fseek(fp, 0, SEEK_END);//从末尾开始写入，防止写入覆盖
	fwrite(newnode, 1, sizeof(Stu), fp);
	fclose(fp);
	return ;
}
//按姓名查找
Stu* NameFind(Stu* stu_node, char find_name[]) {
	//下面是从链表中查找
	if (!stu_node)
		return NULL;
	Stu* cur = stu_node;
	while (cur) {
		if (!strcmp(cur->name, find_name))
			return cur;
		cur = cur->next;
	}
	return NULL;
	
	//文件读取
	/*
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	Stu put_in;
	//当读取完毕时返回0
	while (fread(&put_in, 1, sizeof(Stu), fp)) {
		if (!strcmp(put_in.name, find_name))
			return &put_in;
	}
	fclose(fp);
	return NULL;
	*/
	
}

//按学号查找
Stu* StuNumberFind(Stu* stu_node, Stu* find_stu_number) {
	//链表读取
	if (!stu_node)
		return NULL;
	Stu* cur = stu_node;
	while (cur) {
		if (!strcmp(cur->stu_number, find_stu_number->stu_number))
			return cur;
		cur = cur->next;
	}
	return NULL;


	//文件读取
	/*
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	Stu put_in;
	//当读取完毕时返回0
	while (fread(&put_in, 1, sizeof(Stu), fp)) {
		if (!strcmp(put_in.stu_number, find_stu_number->stu_number))
			return &put_in;
	}
	fclose(fp);
	return NULL;
	*/
}
//小打印
void MyPrintf(Stu* stu_node) {
	if (!print_flag) {
		printf("名字\t    性别\t   学号\t\t    手机号\t    数学成绩\t   英语成绩\t   总成绩\n");
		print_flag = 1;
	}
	printf("%-13s", stu_node->name);
	printf("%-10s", stu_node->sex);
	printf("%-19s", stu_node->stu_number);
	printf("%-20s", stu_node->cell_phone_number);
	printf("%-16d", stu_node->math);
	printf("%-15d", stu_node->english);
	printf("%d\n", stu_node->aggregrate_score);
	return;
}
//显示所有学生信息
void PrintfAllStuInformation(Stu* stu_node) {
	Stu* cur = stu_node;
	while (cur) {
		MyPrintf(cur);
		cur = cur->next;
	}
	print_flag = 0;
	return;
}

//销毁链表，清空文件
void DestoryAllStu(Stu** stu_node) {
	assert(stu_node);
	if (!admin_flag || end_delete_flag) {
		printf("管理员权限才可以进行该操作，请登录\n");
		AdminLogIn();//登录
		if (!admin_flag)
			return;

	}
	//销毁链表
	Stu* delete = NULL;
	while (*stu_node) {
		delete = *stu_node;
		*stu_node = (*stu_node)->next;
		free(delete);
		delete = NULL;
	}

	//清空文件
	FILE* fp = fopen("stu infornation.bin", "w");
	fclose(fp);

	printf("*********	  刷新成功!    ********\n");
	return;
}
Stu* SeekStu(Stu* stu_node) {
	int select;
	printf("** 1.姓名查找   2.学号查找 **\n");
	while (1) {
		int flag = 0;
		printf("请选择要查找的选项>>");
		scanf("%d", &select);
		switch (select) {
		case 1://姓名查找
			flag = 1;
			char find_name[50] = { 0 };
			printf("请输入要查找的姓名>>");
			scanf("%s", find_name);
			Stu* ret1 = NameFind(stu_node, find_name);
			if (!ret1)
				printf("不存在此人\n");
			else {
				MyPrintf(ret1);//打印出该人的信息
				return ret1;
			}
			break;

		case 2://学号查找
			flag = 1;
			Stu find_stu_number;
			printf("请输入要查找的学号>>");
			scanf("%s", find_stu_number.stu_number);
			//Check(&find_stu_number, 2);
			//因为合法性检查里面还有着重复性检查，若此处进行检查，必定触发重复性，因此不进行检查
			Stu* ret2 = StuNumberFind(stu_node, &find_stu_number);
			if (!ret2)
				printf("不存在此人\n");
			else {
				MyPrintf(ret2);
				return ret2;
			}
			break;

		default:
			printf("输入错误,请重新输入\n");
			break;
		}
		if (flag)
			break;

	}

	return NULL;
}

//根据删除一个学生的信息
void DestoryOneStu(Stu** stu_node) {
	assert(stu_node);
	if (!(*stu_node))
		return;//无信息

	Stu* one_stu = SeekStu(*stu_node);
	if (!one_stu) {
		printf("查无此人\n");
		return;
	}

	//必须要先进行文件删除，再进行链表删除，否则链表销毁后，one_stu为野指针
	// 
	//文件中的删除
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	FILE* temp_fp = fopen("temp stu infornation.bin", "wb+");
	if (!temp_fp) {
		perror("create file error:");
		assert(1);
	}

	Stu temp;
	while (fread(&temp, 1, sizeof(Stu), fp)) {
		//姓名和学号进行过查重处理，以此比较是否为要删除的结构体
		if (strcmp(temp.name, one_stu->name) && strcmp(temp.stu_number, one_stu->stu_number))
			fwrite(&temp, 1, sizeof(Stu), temp_fp);
	}
	fclose(fp);
	fclose(temp_fp);
	//删除文件，成功返回0
	if (remove("stu infornation.bin")) {
		perror("delete file error:");
		assert(1);
	}

	//重命名,成功返回0
	if (rename("temp stu infornation.bin", "stu infornation.bin")) {
		perror("rename file error:");
		assert(1);
	}

	//链表删除

	//链表中已经查找到且此时链表只有一个节点时，转销毁函数（此时唯一节点即为要销毁的节点）
	if ((!((*stu_node)->next))){
		end_delete_flag = 1;
		DestoryAllStu(stu_node);
		printf("删除成功\n");
		return;
}

	//多个节点
	//查找要销毁节点的前一个节点
	Stu* cur = *stu_node;
	Stu* delete = NULL;
	Stu* prev = *stu_node;
	while (cur) {
		//多个节点
		if (!strcmp(cur->next->name, one_stu->name) && !strcmp(cur->next->stu_number, one_stu->stu_number))
			break;
		cur = cur->next;
	}
	delete = cur->next;
	cur->next = delete->next;
	free(delete);
	delete = NULL;

	
	printf("删除成功!\n");
	return;
}

//修改学生信息（修改链表信息，修改文件信息）
void Modify(Stu** stu_node) {
	assert(stu_node);
	Stu* modify_stu = SeekStu(*stu_node);//查找学生
	if (!modify_stu) {
		printf("查无此人\n");
		return;
	}
	int select;
	int sz = sizeof(Stu);
	FILE* fp = fopen("stu infornation.bin", "rb+");
	if (!fp) {
		perror("open file error:");
		assert(1);
	}
	printf("  1.修改电话号码     2.修改成绩\n");
	printf("请输入要修改的选项>>");
	scanf("%d", &select);
	switch (select) {
	case 1://修改电话号码
		//链表修改
		printf("请输入修改后的电话号>>");
		scanf("%s", modify_stu->cell_phone_number);
		Check(modify_stu, 3);
		//文件信息修改
		Stu temp;
		int flag = 0;
		while (fread(&temp, 1, sizeof(Stu), fp)) {
			if (!strcmp(temp.name, modify_stu->name) && !strcmp(temp.stu_number, modify_stu->stu_number)) {
				flag = 1;
				break;
			}
		}
		if (!flag) {
			printf("文件中无该学生匹配信息\n");
			return;
		}
		fseek(fp, -sz, SEEK_CUR);
		fwrite(modify_stu, 1, sizeof(Stu), fp);
		//电话号码位数一定，覆盖大小相同
		fclose(fp);
		printf("****  修改成功   ****\n");
		MyPrintf(modify_stu);
		break;
	case 2://成绩修改（可能覆盖不完整,而且是%d格式，因此不建议采用覆盖）
		//链表修改
		printf("请输入修改后的数学成绩>>");
		scanf("%d", &modify_stu->math);
		printf("请输入修改后的英语成绩>>");
		scanf("%d", &modify_stu->english);
		Check(modify_stu, 4);

		modify_stu->aggregrate_score = modify_stu->english + modify_stu->math;
		//总成绩修改
		
		//文件信息修改(重新将修改后的链表写入)
		rewind(fp);
		Stu* cur = *stu_node;
		while (cur) {
			fwrite(cur, 1, sizeof(Stu), fp);
			cur = cur->next;
		}
		fclose(fp);
		printf("成绩修改成功\n");
		MyPrintf(modify_stu);
		break;
	default:
		printf("输入选项不符合规范\n");
		break;
	}
}

//获取当前时间
void MyTime() {
	struct tm* local;
	/*
	int tm_sec;   // seconds after the minute - [0, 60] including leap second
	int tm_min;   // minutes after the hour - [0, 59]
	int tm_hour;  // hours since midnight - [0, 23]
	int tm_mday;  // day of the month - [1, 31]
	int tm_mon;   // months since January - [0, 11]
	int tm_year;  // years since 1900
	int tm_wday;  // days since Sunday - [0, 6]
	int tm_yday;  // days since January 1 - [0, 365]
	int tm_isdst; // daylight savings time flag
	*/
	time_t t;
	t = time(NULL);//获取时间
	//localtime函数将日历时间转化成本地时间
	local = localtime(&t);
	printf("2022.%d.%d>>%d:%d:%d\n", local->tm_mon + 1, local->tm_mday, local->tm_hour, local->tm_min, local->tm_sec);
	//gmtime 将日历时间转化为世界时间
	//local = gmtime(&t);
	//printf("UTC hour is: %d\n", local->tm_hour);
}

//屏幕刷新
void Refresh() {
	system("cls");
	Menu();
	return;
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------

void TestStu() {
	//全局变量初始化
	print_flag = 0;//打印标志
	admin_flag = 0;//管理员登录标志初始化
	end_delete_flag = 0;//删除最后一个节点时所有标志

	Color(11);//颜色设置

	Menu();//主页面

	CreateAdminFile();//管理员登录信息文件

	CreateMyFile();//创建文件

	Stu* stu_node = NULL;
	ReadMyFile(&stu_node);
	PrintSize(stu_node);
	char select = '1';
	do {
		printf("请输入你的操作选项>>");
		scanf(" %c", &select);
		//当使用%d时，若输入类型不匹配，则不进行读取，select始终为1
		//getchar();//吞白
		//选择设置为char型
		//1.节省空间
		//2.方便使用isdigit检验
		if(!isdigit(select)){
			printf("输入错误，请重新输入>>");
			scanf(" %c", &select);
			//getchar();
		}
		switch (select) {
		case '1':
			Color(12);
			IncreaseStuInfo(&stu_node);//增加学生信息
			PrintSize(stu_node);
			//getchar();//防止下一次循环开始时select 读取 '\n'
			break;
		case '2':
			Color(13);
			Modify(&stu_node);//学生信息修改
			break;
		case '3':
			Color(14);
			SeekStu(stu_node);//查找学生信息
			//getchar();//防止下一次循环开始时select 读取 '\n'
			break;
		case '4':
			Color(9);
			PrintSize(stu_node);
			PrintfAllStuInformation(stu_node);//打印所有学生信息
			break;
		case '5':
			Refresh();//屏幕刷新；
			break;
		case '6':
			Color(10);
			DestoryOneStu(&stu_node);//删除某学生信息
			break;
		case '7':
			DestoryAllStu(&stu_node);//删除链表，清空文件
			break;
		case '8':
			Color(10);
			PrintSize(stu_node);//打印目前添加学生人数
			break;
		case '9':
			Color(14);
			RankAggregateScore(stu_node);//排序
			break;
		case '0':
			printf("********	退出系统成功!	*******\n");
			//结束时间
			Color(12);
			MyTime();
			select = 0;
			break;

		default:
			printf("选择错误，请重新选择\n");
			break;
		}
	} while (select);

	return;
}
#endif